package com.swyc.osschat.Test.designMode.builder.run;

import com.swyc.osschat.Test.designMode.builder.base.Builder;

/**
 * @description 指挥者类
 * @Author: z156940l@outlook.com
 * @className ComputerDirector
 * @Date: 2022/7/25 18:03
 */
public class ComputerDirector {
    //持有一个建造者
    private Builder builder;

    public ComputerDirector(Builder builder){
        this.builder = builder;
    }
    //构建产品
    public Computer construct(String mainBoard,String cpu,String ram){
        builder.buildMainBoard(mainBoard);
        builder.buildCpu(cpu);
        builder.buildRam(ram);
        return builder.build();
    }
}